//microcommand define -lnn-forceencoding
const execa = require("execa")
signature("<encoding> <text:rawtext>", { strictOptions: true })
action(({}, encoding, text) => {
  return execa("python3", ["./assets/bin/forceencoding.py", encoding], {
    input: text,
    env: {
      PYTHONIOENCODING: "utf-8",
    },
  }).then(
    ({ stdout }) => h.escape(stdout),
    err => h.text(String(err))
  )
})